<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { useKeepAliveStore } from '@/stores/keepAlive';
import { ElConfigProvider } from 'element-plus';

import zhCn from 'element-plus/es/locale/lang/zh-cn';

// 一级视图缓存
const keepStroe = useKeepAliveStore();
const firstKeepAliveRoute = keepStroe.firstKeepAliveRoute;

const locale = ref(zhCn);

onMounted(() => {});
</script>

<template>
  <router-view v-slot="{ Component }">
    <keep-alive :include="firstKeepAliveRoute">
      <el-config-provider :locale="locale">
        <component :is="Component" />
      </el-config-provider>
    </keep-alive>
  </router-view>
</template>

<style>
@import url('@/assets/style/main.css');
</style>
